package com.ruoyi.apduParse.factory;

import com.ruoyi.apduParse.strategy.*;

import java.util.List;

public class SentenceStrategyFactory {

    public static SentenceStrategy getStarategy(String apduName){

        //APPLICATION UNBLOCK
        //根据传入的指令名称返回相应的拼接语句
        switch (apduName) {
            case "INSTALL": //安装指令
                return new InstallSentenceStrategy();
            case "SELECT": //选择指令
                return new SelectSentenceStrategy();
            case "DELETE": //删除指令
                return new DeleteSentenceStrategy();
            case "GET APPLET STATE": //获取应用状态指令
                return new GetAppletStatusSentenceStrategy();
            case "INITIALIZE UPDATE": //初始化安全通道指令
                return new InitializeUpdateSentenceStrategy();
            case "EXTERNAL AUTHENTICATE": //外部认证指令
                return new ExternalAuthenticateSentenceStrategy();
            case "PUT KEY": //写入密钥指令
                return new PutKeySentenceStrategy();
            case "LOAD": //装载cap包指令
                return new LoadSentenceStrategy();
            case "STORE DATA": //写入个人化数据指令
                return new StoreDataSentenceStrategy();
            case "GET DATA": //获取数据指令
                return new GetDataSentenceStrategy();
            case "SET STATUS": //获取数据指令
                return new SetStatusSentenceStrategy();
            case "APPLICATION BLOCK": //应用锁定指令
                return new ApplicationBlockSentenceStrategy();
            case "APPLICATION UNBLOCK": //应用解锁指令
                return new ApplicationBlockSentenceStrategy();
            case "READ BINARY": //读取二进制文件指令
                return new ReadBinarySentenceStrategy();
            case "READ RECORD": //读取记录指令
                return new ReadRecordSentenceStrategy();
            case "UPDATE BINARY": //更新二进制文件指令
                return new UpdateBinarySentenceStrategy();
            case "UPDATE RECORD": //修改记录指令
                return new UpdateRecordSentenceStrategy();
            case "CHANGE PIN": //修改记录指令
                return new UpdateRecordSentenceStrategy();
            default:
                return new ErrorStrategy();
        }


    }



}
